/*
 * Bsp_Uart.h
 *
 *  Created on: Apr 4, 2025
 *      Author: Administrator
 */

#ifndef BSP_UART_H_
#define BSP_UART_H_

#include <stdint.h>
#include"Bsp.h"

#define UART_BUFFER_SIZE 256

typedef struct {
    uint8_t buffer[UART_BUFFER_SIZE];
    volatile uint16_t head;
    volatile uint16_t tail;
} RxBuffer;

/*******/
void USART1_Init(void) ;
void USART1_Send_U8 (uint8_t ch);
void USART1_Send_ArrayU8(uint8_t *BufferPtr, uint16_t Length);
/********/

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart);
int UART_Buffer_Put(uint8_t data);
int UART_Buffer_Get(uint8_t *data);
int UART_Buffer_IsFull(void);
int UART_Buffer_IsEmpty(void);
uint16_t UART_Buffer_Count(void);


#endif /* BSP_UART_H_ */
